package com.hmall.common.config.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MqErrorMessageListener {

    @RabbitListener(queues = "${spring.application.name}.error.queue")
    public void handleErrorMessage(Message message) {
        log.error("收到消费失败的消息，准备后续处理：{}", message);
        // TODO: 持久化、报警、人工介入等
    }
}
